#!/bin/bash
#    radioslibres-mpv.bash - A simple bash script with mpv.
#    Copyright (C) 2015  zorro@inventati.org
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see http://www.gnu.org/licenses/ .
#

if [[ -z $1 ]] ; then
    cat << EOF
$0 A bash script to listen Radios Libres with mpv.

	Select a radio stream:

	-radioela > Radio ELA Madrid
	-rlvigo > Radio Libre Vigo
	-rvallekas > Radio Vallekas
	-ralmenara > Radio Almenara Madrid
	-contrabanda > Contrabanda FM BCN
	-radiomalva > Radio Malva VLC
	-irola > Irola Irratia Bilbao
	-almaina > Radio Almaina Granada
	-bala > Radio Bala Manresa
	-rkras > Radio Kras Xixón
	-bronka > Radio Bronka BCN
	-granja > Radio La Granja ZGZ
	-linea4 > Radio Linea IV BCN
	-radiomai > Radio MAI ZGZ
	-mutant > Radio Mutant Alacant
	-pirineo > Radio Pirineo Huesca
	-radioqk > Radio QK Oviedo
	-radiorsk > Radio RSK BCN
	-topo > Radio Topo ZGZ
	-aktiva > Radio Aktiva Alcoy
	-zinzilik > Zintzilik Irratia Orereta
	-radiopolis > Radiopolis Sevilla
	-radioutopia > Radio Utopia Madrid
	-nonina > Onda NoNiNá Albacete
	-mistelera > Radio La Mistelera Denia
	-arraio > Arraio Irratia Zarautz
	-piratona > Radio Piratona Vigo
	-filispim > Radio FilispiM Ferrol
	-cuacfm > Cuac FM Coruña
	-radiopica > Radio Pica Barcelona
	-agorasol > Agora Sol Madrid
	-gsalad > Groove Salad, soma.fm
	-spaces > Space Station, soma.fm
	-secret > Secret Agent, soma.fm
	-dubstep > Dubstep, soma.fm
	-defcon > DEF CON, soma.fm
	-binario > Radio Binario, elbinario.net
EOF
	exit 1
fi

case ${1} in
	"-radioela")
	mpv "http://radio.nodo50.org:8001/radioela.mp3" ;;
	"-rlvigo")
	mpv "http://giss.tv:8000/todovigo.ogg" ;;
	"-rvallekas")
	mpv "http://radiovallekas.org/emision.m3u" ;;
	"-ralmenara")
	mpv "http://91.121.134.23:8000/radioalmenara.mp3" ;;
	"-contrabanda")
	mpv "http://www.porticoluna.org:8000/contrabanda" ;;
	"-radiomalva")
	mpv "http://radiomalva.ddns.net:8000/rmbc.ogg" ;;
	"-irola")
	mpv "http://s.streampunk.cc/irola_irratia.ogg" ;;
	"-almaina")
	mpv "http://s.streampunk.cc/almaina.ogg" ;;
	"-bala")
	mpv "http://s.streampunk.cc/radiobala.ogg" ;;
	"-rkras")
	mpv "http://giss.tv:8000/RadioKras.mp3" ;;
	"-bronka")
	mpv "http://radiobronka.info/escuchar" ;;
	"-granja")
	mpv "http://www.radiolagranja.org/radiolagranja.m3u" ;;
	"-linea4")
	mpv "http://212.83.172.164:9972/;stream.mp3" ;;
	"-radiomai")
	mpv "http://178.33.25.204:8001/stream" ;;
	"-mutant")
	mpv "http://vps66370.ovh.net:8000/mutant.ogg" ;;
	"-pirineo")
	mpv "http://giss.tv:8001/radiopirineo.mp3" ;;
	"-radioqk")
	mpv "http://stream.giss.tv:8001/radioqk.mp3" ;;
	"-radiorsk")
	mpv "http://stream.nonfqdn.net:8000/rsk.mp3" ;;
	"-topo")
	mpv "http://90.69.168.108:888/radiotopo.mp3" ;;
	"-aktiva")
	mpv "http://vps66370.ovh.net:8000/aktiva.ogg" ;;
	"-zinzilik")
	mpv "http://airean.net:9001/zintzilik.ogg" ;;
	"-radiopolis")
	mpv "http://streaming.radiopolis.org:8000/radiopolisevilla.ogg" ;;
	"-radioutopia")
	mpv "http://ondametadona.net:8000/radio-utopia" ;;
	"-nonina")
	mpv "http://airtime.elpincho.net:8000/ondanonina.ogg" ;;
	"-mistelera")
	mpv "http://s1.streamaudio.de:8000/radio-mistelera" ;;
	"-arraio")
	mpv "http://www.arraio.net:9001/irratia.ogg" ;;
	"-piratona")
	mpv "http://giss.tv:8000/alg-a.ogg" ;;
	"-filispim")
	mpv "http://46.105.178.31:8012/stream" ;;
	"-cuacfm")
	mpv "https://streaming.cuacfm.org/cuacfm.ogg" ;;
	"-radiopica")
	mpv "http://srv0625.lcinternet.com:8016/stream" ;;
#	mpv "http://88.2.32.168:8000/" ;;
	"-agorasol")
	mpv "http://tesla.eldialdigital.com:9370/" ;;
	"-gsalad")
	mpv "http://somafm.com/groovesalad64.pls" ;;
	"-spaces")
	mpv "http://somafm.com/spacestation64.pls" ;;
	"-secret")
	mpv "http://somafm.com/secretagent64.pls" ;;
	"-dubstep")
	mpv "http://somafm.com/dubstep64.pls" ;;
	"-defcon")
	mpv "http://somafm.com/defcon64.pls" ;;
	"-binario")
	mpv "http://radio.elbinario.net:8000/radio.ogg" ;;
    *)
    echo "$0 Error. Please, specify a parameter to start a radio stream." >&2 ;;
esac
